package app.web.admin.domain.pojo;

import app.core.ar.Ar;
import com.gitee.feizns.quickstart.ddl.annotation.Comment;
import lombok.Data;
import lombok.EqualsAndHashCode;

import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 角色菜单权限
 * @author feizns
 * @since 2025/3/11
 */
@Data
@Entity
@Comment("角色菜单权限")
@EqualsAndHashCode(callSuper = true)
@Table(name = "admin_role_of_menu")
@com.mybatisflex.annotation.Table(value = "admin_role_of_menu", comment = "角色权限")
public class AdminRoleOfMenu extends Ar<AdminRoleOfMenu> {

    /**
     * 角色编号
     */
    @Comment("角色编号")
    private Long roleId;

    /**
     * 权限编号
     */
    @Comment("权限编号")
    private Long menuId;

    /**
     * 构建指定用户的角色记录
     * @return {@link AdminRoleOfMenu }
     */
    public static AdminRoleOfMenu of(Long roleId, Long menuId) {
        AdminRoleOfMenu adminRoleOfMenu = new AdminRoleOfMenu();
        adminRoleOfMenu.setRoleId(roleId);
        adminRoleOfMenu.setMenuId(menuId);
        return adminRoleOfMenu;
    }

}
